home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-04-04 | 74.4 KB | 2,612 lines |
- Newsgroups: comp.sources.unix
- From: phil@Shiva.COM (Phil Budne)
- Subject: v25i164: finger - Phil's Finger Program, Part01/07
- Sender: unix-sources-moderator@pa.dec.com
- Approved: vixie@pa.dec.com
-
- Submitted-By: phil@Shiva.COM (Phil Budne)
- Posting-Number: Volume 25, Issue 164
- Archive-Name: finger/part01
-
- [ This is the last of Volume 25, and the last of the things inherited from
- the previous moderator. Submissions received since November 1991 will be
- in Volume 26, which I'll open next week. --vix ]
-
- This is a new distribution of "finger" Un*x systems I have written. It
- was written in the spirit of ITS and TOPS-20 fingers.
-
- Here is some sample output;
-
- -User- --Full name-- -What- Idle TTY -Console Location-
- budd + Philip Budne finger p2 buit2:0; Office: MCS 107
- bzs + Barry Shein csh 5:13 p5 bu-cs (Remote Login)
- csh 8:30 p8 buit4 (Remote Login)
- jdh S Jason Heirtzler xemacs 7:45 p0 buit12 (X display 0)
- tower + Leonard H. Tower Jr. csh 6:59 p4 buit3 (X display 0)
- xemacs 4:26 p6 buit3 (X display 0)
- xemacs+5:02 p7 buit3 (X display 0)
-
- Finger has run on the following systems (See README for a more
- detailed and current list);
-
- VAX (BSD and Ultrix)
- SunOS (Sun-2,3,4,386i)
- Encore Multimax (Umax 4.2, Umax V)
- Celerity accel
- IBM RT/PC (ACIS 4.3, AIX 2.1.2)
- Silicon Graphics (MIPS)
- DEC{station,system!} 3100
- Sony News (68020)
- Interactive 386/ix S5R3.2
-
- I would like to hear from anyone who ports this to a new architecture.
-
- Phil Budne
- Boston, July 6, 1990
- budd@bu-it.bu.edu
- uunet!bu-it.bu.edu!budd
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 1 (of 7)."
- # Contents: COMDEFALL COPYRIGHT COUNT Cover DIFFALL Distfile FINDDEFS
- # MODES ORIG README SAMPLE-conf SAMPLE-flags SAMPLE-nttyloc VERSION
- # WISHES cc-M daemon.h defs.awk fingerd.8c getgroup.c global.c
- # hungry hungry/README hungry/hungry.1c hungry/hungry.c
- # hungry/hungry.h hungry/rwho-changes hungry/rwho.1c-changes
- # hungry/rwhod-changes inet_netof.c inet_ntoa.c info.h inquire.c
- # inquire.h kmem.h locname.c make-version myecho.c mywhoami.c
- # output.h person.h pr.h pversion.c remote.h skip.c strings.h
- # symdate.c tsel.h ttylocfile.h upper.c upper.h waitstate.h
- # Wrapped by budd@bu-it on Fri Jul 6 13:21:59 1990
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f COMDEFALL -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"COMDEFALL\"
- else
- echo shar: Extracting \"COMDEFALL\" \(605 characters\)
- sed "s/^X//" >COMDEFALL <<'END_OF_COMDEFALL'
- X#!/bin/sh
- X# re-comdef files which need it
- X# Copyright (C) 1989, 1990 Philip L. Budne
- X#
- X# This file is part of "Phil's Finger Program".
- X#
- X# This program is free software; you can redistribute it and/or modify
- X# it under the terms of the GNU General Public License as published by
- X# the Free Software Foundation; either version 1, or (at your option)
- X# any later version.
- X#
- X
- X# $Id: COMDEFALL,v 3.0 90/07/06 13:09:42 budd Rel $
- X
- Xtmp=/tmp/comdef$$
- Xfor f in *.[ch] *.cpp ymakefile; do
- X comdef < $f > $tmp
- X if cmp -s $f $tmp; then
- X echo >/dev/null
- X else
- X echo $f has changed
- X cp $tmp $f
- X fi
- Xdone
- Xrm -f $tmp
- END_OF_COMDEFALL
- if test 605 -ne `wc -c <COMDEFALL`; then
- echo shar: \"COMDEFALL\" unpacked with wrong size!
- fi
- chmod +x COMDEFALL
- # end of overwriting check
- fi
- if test -f COPYRIGHT -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"COPYRIGHT\"
- else
- echo shar: Extracting \"COPYRIGHT\" \(421 characters\)
- sed "s/^X//" >COPYRIGHT <<'END_OF_COPYRIGHT'
- X/*
- X * Copyright (C) 1986, 1990 Philip L. Budne
- X *
- X * This file is part of "Phil's Finger Program".
- X *
- X * This program is free software; you can redistribute it and/or modify
- X * it under the terms of the GNU General Public License as published by
- X * the Free Software Foundation; either version 1, or (at your option)
- X * any later version.
- X */
- X
- X# define FOO_RCSID "$Id$"
- X
- X#ifndef lint
- Xstatic char *rcsid = "$Id$";
- X#endif
- END_OF_COPYRIGHT
- if test 421 -ne `wc -c <COPYRIGHT`; then
- echo shar: \"COPYRIGHT\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f COUNT -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"COUNT\"
- else
- echo shar: Extracting \"COUNT\" \(177 characters\)
- sed "s/^X//" >COUNT <<'END_OF_COUNT'
- Xecho TODO:
- Xgrep '^[0-9]' TODO | wc -l
- Xecho TODOs in code:
- Xgrep TODO *.[ch] | wc -l
- X
- Xecho WISHES file:
- Xgrep '^[0-9]' WISHES | wc -l
- Xecho WISHs in code:
- Xgrep WISH *.[ch] | wc -l
- X
- END_OF_COUNT
- if test 177 -ne `wc -c <COUNT`; then
- echo shar: \"COUNT\" unpacked with wrong size!
- fi
- chmod +x COUNT
- # end of overwriting check
- fi
- if test -f Cover -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"Cover\"
- else
- echo shar: Extracting \"Cover\" \(1253 characters\)
- sed "s/^X//" >Cover <<'END_OF_Cover'
- XThis is a new distribution of "finger" Un*x systems I have written. It
- Xwas written in the spirit of ITS and TOPS-20 fingers.
- X
- XHere is some sample output;
- X
- X-User- --Full name-- -What- Idle TTY -Console Location-
- Xbudd + Philip Budne finger p2 buit2:0; Office: MCS 107
- Xbzs + Barry Shein csh 5:13 p5 bu-cs (Remote Login)
- X csh 8:30 p8 buit4 (Remote Login)
- Xjdh S Jason Heirtzler xemacs 7:45 p0 buit12 (X display 0)
- Xtower + Leonard H. Tower Jr. csh 6:59 p4 buit3 (X display 0)
- X xemacs 4:26 p6 buit3 (X display 0)
- X xemacs+5:02 p7 buit3 (X display 0)
- X
- XFinger has run on the following systems (See README for a more
- Xdetailed and current list);
- X
- X VAX (BSD and Ultrix)
- X SunOS (Sun-2,3,4,386i)
- X Encore Multimax (Umax 4.2, Umax V)
- X Celerity accel
- X IBM RT/PC (ACIS 4.3, AIX 2.1.2)
- X Silicon Graphics (MIPS)
- X DEC{station,system!} 3100
- X Sony News (68020)
- X Interactive 386/ix S5R3.2
- X
- XWhere to get it;
- X anonymous ftp from BU.EDU, directory "users/budd/finger"
- X in tar, compressed tar, and shar files.
- X
- X I will soon be submitting it to a Usenet sources group.
- X
- XI would like to hear from anyone who ports this to a new architecture.
- X
- X Phil Budne
- X Boston, July 6, 1990
- X budd@bu-it.bu.edu
- X uunet!bu-it.bu.edu!budd
- END_OF_Cover
- if test 1253 -ne `wc -c <Cover`; then
- echo shar: \"Cover\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f DIFFALL -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"DIFFALL\"
- else
- echo shar: Extracting \"DIFFALL\" \(515 characters\)
- sed "s/^X//" >DIFFALL <<'END_OF_DIFFALL'
- X#!/bin/sh
- X# diff any files with emacs backup files
- X# Copyright (C) 1989, 1990 Philip L. Budne
- X#
- X# This file is part of "Phil's Finger Program".
- X#
- X# This program is free software; you can redistribute it and/or modify
- X# it under the terms of the GNU General Public License as published by
- X# the Free Software Foundation; either version 1, or (at your option)
- X# any later version.
- X#
- X
- X# $Id: DIFFALL,v 3.0 90/07/06 13:09:43 budd Rel $
- X
- Xfor x in *.orig; do
- X y=`basename $x .orig`
- X echo $y
- X diff -c $x $y >$y.diff
- Xdone
- END_OF_DIFFALL
- if test 515 -ne `wc -c <DIFFALL`; then
- echo shar: \"DIFFALL\" unpacked with wrong size!
- fi
- chmod +x DIFFALL
- # end of overwriting check
- fi
- if test -f Distfile -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"Distfile\"
- else
- echo shar: Extracting \"Distfile\" \(381 characters\)
- sed "s/^X//" >Distfile <<'END_OF_Distfile'
- X# $Id: Distfile,v 3.0 90/07/06 13:09:45 budd Rel $
- X
- XFILES = (
- X *.[ch] Makefile Distfile ymakefile *.1 *.5 *.8c Install.cpp
- X *.m4 autoconfig TODO WISHES MODES SAMPLE-local-flags Cover
- X README make-version
- X )
- X
- XEX = ( args.h local.h version.c symdate.h )
- X
- XHOSTS = ( bucsf bucsb dolphin bu-pub bu-it schlitz grizzly buchmf )
- X
- X${FILES} -> ${HOSTS}
- X install src/finger ;
- X except ${EX} ;
- END_OF_Distfile
- if test 381 -ne `wc -c <Distfile`; then
- echo shar: \"Distfile\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f FINDDEFS -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"FINDDEFS\"
- else
- echo shar: Extracting \"FINDDEFS\" \(145 characters\)
- sed "s/^X//" >FINDDEFS <<'END_OF_FINDDEFS'
- Xegrep '^#' *.[ch] ymakefile Install.cpp > defs
- Xecho ==
- Xawk -f defs.awk defs | sort | uniq
- Xecho ==
- Xgrep ' if ' defs
- Xecho ==
- Xgrep ' defined ' defs
- END_OF_FINDDEFS
- if test 145 -ne `wc -c <FINDDEFS`; then
- echo shar: \"FINDDEFS\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f MODES -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"MODES\"
- else
- echo shar: Extracting \"MODES\" \(58 characters\)
- sed "s/^X//" >MODES <<'END_OF_MODES'
- X
- X/*
- X * Local variables:
- X * comment-column: 40
- X * End:
- X */
- END_OF_MODES
- if test 58 -ne `wc -c <MODES`; then
- echo shar: \"MODES\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f ORIG -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"ORIG\"
- else
- echo shar: Extracting \"ORIG\" \(158 characters\)
- sed "s/^X//" >ORIG <<'END_OF_ORIG'
- X#!/bin/sh
- X# $Id: ORIG,v 3.0 90/07/06 13:10:15 budd Rel $
- Xif [ -f $1.orig ]; then
- X echo $1.orig exists 1>&2
- X exit 1
- Xfi
- Xmv $1 $1.orig
- Xcp $1.orig $1
- Xchmod +w $1
- END_OF_ORIG
- if test 158 -ne `wc -c <ORIG`; then
- echo shar: \"ORIG\" unpacked with wrong size!
- fi
- chmod +x ORIG
- # end of overwriting check
- fi
- if test -f README -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"README\"
- else
- echo shar: Extracting \"README\" \(10524 characters\)
- sed "s/^X//" >README <<'END_OF_README'
- XCopyright (C) 1988, 1990 Philip L. Budne
- X
- XThis file is part of "Phil's Finger Program".
- X
- XThis program is free software; you can redistribute it and/or modify
- Xit under the terms of the GNU General Public License as published by
- Xthe Free Software Foundation; either version 1, or (at your option)
- Xany later version.
- X
- XThis program is distributed in the hope that it will be useful,
- Xbut WITHOUT ANY WARRANTY; without even the implied warranty of
- XMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- XGNU General Public License for more details.
- X
- XYou should have received a copy of the GNU General Public License
- Xalong with this program; if not, write to the Free Software
- XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- X
- X================================================================
- X
- XThis program is my shaggy dog story, it grew in the telling (it has
- Xuncovered more than one bug in gcc over the years). I started by
- Xwanting a free source finger which sorted output by username. It was
- Xmy first major undertaking on Unix (before I knew about qsort(3)), and
- Xin the words of Bruce Leverett in "Register Allocation in Optimizing
- XCompilers";
- X
- X But in our enthusiasm, we could not resist a radical overhaul
- X of the system, in which all of its major weaknesses have been
- X exposed, analyzed, and replaced with new weaknesses.
- X
- X================================================================
- X$Id: README,v 3.0 90/07/06 13:10:17 budd Rel $
- X================================================================
- XThis program has run under;
- X
- X VAX
- X BSD 4.2 (11/730,750,780) LONG AGO
- X BSD 4.3 (11/750) 2(335) 6/22/89
- X Ultrix 3.0 (VS-II/GPX) 2(337) 7/89
- X Ultrix 3.1 (6410) 2(341) 2/17/90
- X
- X Sun-2
- X 3.2 (2/120) 2(332) 6/15/89
- X
- X Sun-3
- X 3.4 (3/50,60,160,180,280) 2(341) 7/13/89
- X 3.5 (3/50,180) 2(341) 7/14/89
- X 4.0.1 (3/60) 2(367) 6/26/90
- X 4.0.3 (3/50,60,80,160,180,280) 2(336) 6/26/89
- X
- X Sun-4
- X 3.2 (4/280) 2(336) 6/25/89
- X 4.0.3 (4/60,110,280) 2(367) 6/20/90
- X 4.1 (4/65) 2(367) 6/26/90
- X
- X Sun 386i
- X 4.0.1, 4.0.3 2(355) 5/8/90
- X
- X Encore Multimax Umax 4.[23]
- X 3.1 XPC (ns32532) 2(367) 6/25/90
- X 3.1 APC (ns32332) 2(332) 6/15/89
- X 3.1 DPC (ns32032) 2(304) 7/21/88
- X
- X 4.0 APC (ns32332) 2(367) 6/20/90
- X
- X Encore Multimax Umax V S5R3.1
- X 2.2h APC (ns32332) 2(367) 6/25/90
- X
- X Celerity accel
- X 3.4.87 C1260D,C1200 2(363) 5/18/90
- X
- X IBM ROMP
- X AIX 2.1.2 RT-125 2(367) 6/25/90
- X ACIS/AOS 4.3 (pcc or hc 1.4)
- X ATR-6152, RT-125,130 2(336) 6/25/89
- X
- X Silicon Graphics (sgi)
- X 3.1F 4D/IP5 (MIPS R2000) 2(336) 6/26/89
- X 3.2.1 4D/IP6 (MIPS R2000A) 2(355) 4/25/90
- X 3.2.1 4D/IP7 (MIPS R3000) 2(364) 5/23/90
- X
- X DECstation-3100 Ultrix 3.1 2(355) 4/25/90
- X
- X Sony NEWS-OS 3.2 News-841 (68020) 2(346) 1/4/90
- X
- X Interactive 386/ix S5R3.2 2(350) 1/12/90
- X
- X Sequent DYNIX (ucb universe)
- X 3.0.17.10.2 S3 (i386) 2(362) 5/17/90
- X
- X IBM RIOS
- X AIX 3.1 9013S1 RS/6000 mod 320 2(365) 6/4/90
- X
- XPorts to new architectures will almost certainly have to modify
- Xustruct.[ch], readpr.c and perhaps read_vmunix.c and getcommand.c
- X
- XIf you port to any new machines or operating systems, please send the
- Xdiffs to me (see the ORIG and DIFFALL scripts).
- X
- XDefines of interest (put in local-flags);
- X
- XALWAYS_PRINT_HEADER If defined print header line even if only one user
- XARCHITECTURE String used by fingerd to formulate default banner
- X defaulted by architecture if not set
- XAUTONLIST If defined check to see that running kernel
- X matches saved-nlist file
- XBIG_CONSOLE String to tag on display of virtual console
- X (def: "[console]")
- XBUFIO If non-zero read kmem etc with stdio (total lose)
- XC_COMPILER Optional name of C compiler to use (ymakefile)
- XC_FLAGS Optional flags to pass to C compuler (ymakefile)
- XDEBUG If defined turns on debugging. Usually used per-module
- XDEBUGSW If defined "-deb" option prints useful information
- XDEFAULT_DAEMON Ttyloc string to display if no daemon & on PTY
- X (Default: "Virtual Terminal")
- XDEFCYCLE Default integer cycle time (in seconds) for
- X ttyrandom/ttycycle and ttyloc timeouts (def: 120sec)
- XDEFSHELL String containing default shell name (Def: "/bin/csh")
- XDEFWIDTH Default integer terminal with if cannot get
- X from termcap
- XDONT_TAB_PLAN If defined, do not tab in plan by one tab stop
- XDONT_SAY_HACKING Don't use the "H" word in whois displays
- XDONT_SAY_TRYING Suppress Trying ... messages for remote finger
- XDONT_USE_TTYENT_TYPE_AS_SHORT
- X If defined do NOT use 4.3 style /etc/ttys ttytype
- X as "short" location
- XEMPTY_CMD String to print if no command found (default "??")
- XFINGER0 Argv[0] passed by fingerd to finger (def "finger")
- XFINGERPATHS Optional list of strings containing local paths for
- X fingerd to use to try to invoke finger
- XGETPWNAM_SLOW If defined avoid repeated use of getpwnam()
- XGRP_HEADER Character to use as header for group column in display
- XHIDDEN_PROGRAMS Optional list of names (strings) of programs that you
- X might not want to have displayed (ie; "gamescontrol")
- XINCLUDE_PATH Any -I commands needed for compilation.
- X (ie; if you need to get a special netdb.h for resolver)
- XINETD If defined compile finderd for launch by inetd
- XINIT_PID Integer pid of "init" process (parent of all) (def: 1)
- XINQUIRE If defined, use an inquire database (see NINQUIRE)
- XIPPORT_FINGER TCP port to use if services lookup failes (def: 79)
- XJUST_ADDR_GIVEN If defined do just address specified by finger @number
- XKERNEL_FILE String name of booted kernel (def: "/vmunix")
- XKMEM_GROUP 4.3 group with read access to /dev/kmem... (Install.cpp)
- XLIB_RESOLVE Path (or -lname) for resolver library, if desired.
- XLLPATH Path for BSD lastlog file (def: "/usr/adm/lastlog")
- X needs to be replaced by something PER NFS clusterer.
- XLMASK If defined (per architecture) mask for start addr
- X to get kernel load address.
- XLOADADDR If defined (per architecture) used as kernel load
- X address (overrides LMASK)
- XLOCAL_DAEMONS Optional local daemons which can parent "logins"
- X (see daemons.c)
- XLOCFILE Name of old style ttyloc file (def: "/etc/ttyloc")
- XMINCYCLE Minimum integer cycle time in seconds for ttycycle...
- X (Default: 60sec)
- XMONNAME Filename to get fingerd banner from (def: "/etc/monnam")
- XMUST_HAVE_TTY If defined Only fetch ustruct for process' with
- X control terminals. finger runs faster but gives less
- X interesting default ttylocs.
- XNETBERK If defined, remotely invoked finger uses -berk option
- XNETFOLLOW If defined, remotely invoked finger uses -follow option
- XNETLOC If defined, check for BU local U/B network location
- XNEVER_SAME If defined, never suppress uname and pname in displays.
- XNINQUIRE If defined (with INQUIRE) use "new inquire" system.
- X (To be released at a future date)
- XNINQUIRE_MATCH Perform person lookups my matching against
- X whole personal name. Does not work due to commas.
- X Default is to use lastname hash table.
- XNLIST_MODE Integer file mode for saved-nlist file creation
- XNLOCFILE Name of new style ttyloc file (def: "/etc/nttyloc")
- XNO_X_WINDOWS If defined suppress special processing for HOST:DISPLAY
- XNOLOGIN Name of no logins file (def: "/etc/nologin")
- XNON_HARDWIRE_TYPES Optional list of TERM types to treat as non-hardwired
- X in ttyask
- XNOSTRIP If defined, Install will not strip installed files
- XOTTYLOC If defined check ~/.ttyloc file (depricated)
- XPAGER Pager to use for help output. (def: "more")
- XPICKY If defined, make sure new /vmunix matches running kernel
- XPID_BITS Default number of bits in a Un*x pid. (def: 15)
- XPID_T Type for a pid. (def: short)
- XPREFIXES Host prefixes to remove if ttyloc set. See SAMPLE*
- XPRESERVE_HOST_CASE If defined do not upcase host names.
- XPRJLEN Max length of string to get from .project file (def: 70)
- XPTYPATH Path for a known pseudo terminal tty (slave end)
- X (def: "/dev/ttyp0")
- XRELATION If defined display INQUIRE relation as well as group
- XREL_SUP If defined, a string of RELATIONS to not display
- XSAVED_NLIST If defined, save namelist to SAVED_NLIST file
- XSMALL_CONSOLE Short string to tag on display of virtual console.
- X (def: "[console]" -- was once "[cons]")
- XSUID_OTHER Char displayed after programs running under alien uid.
- XSUID_ROOT Char displayed after programs running suid root.
- XSUPPRESS_WHAT If defined suppress display of "-What-"
- XSYSLOG If defined fingerd performs syslog()ing
- XGETTTYENT If Defined use getttyent routines to get tty type
- XTTYLOC_DIR String containing directory for ttyloc files
- XTTYLOC_MODE Integer mode for ttyloc file creation
- XTTY_GROUP If defined, assume ttys group write to this group
- XTTY_GROUP_NUMBER If defined, use as fallback if TTY_GROUP lookup fails
- XTTY_REQUIRES_IOCTL If defined #include sys/tty.h before sys/ioctl.h
- XUID_NOBODY Integer uid to run finger under from fingerd (def: -2)
- XUNPREFIX_NODOMAIN If defined, remove PREFIXES from hosts w/o domains.
- XUPTIME Program to invoke from fingerd to give
- X amusing system stats. (def: "/usr/ucb/uptime")
- XUPTIME0 Argv[0] to pass UPTIME program
- XUSE_ALL_TTYENTS If defined do not throw out ttys marked as off in 4.3
- X /etc/ttys file when scanning for ttylocs
- XUSER_NOBODY User to run finger from in fingerd to fall under
- X per user process limits. Helps prevent
- X runaway .forward loops.
- XX10_STR String used to note X10 xterms (def: "X10")
- XX11_STR String used to note X11 xterms (have screen number)
- X (def: "X11")
- XX_LOCAL If defined treat local xterms differently
- XBUGS_TO Mailing address for bug reports. Displayed
- X in help output. (def: "bug-finger@bu-it.bu.edu")
- X
- XThe following files contain stuff that will vary from site to site:
- X
- Xlocname.h
- X At BU-CS we run ttyloc suid daemon and have /usr/spool/ttyloc
- X owned by daemon, with all files created with mode 644.
- X
- X You might want to put the files in /tmp, and have the files be
- X world read/write.
- X
- Xfingerd:
- X Define INETD if you have an inet daemon, and add the correct
- X line to /etc/servers.
- X
- X finger should be installed as /usr/bin/finger (not in /usr/ucb).
- X
- Xtty locations:
- X see the nttyloc.5 man page. An alternative is:
- X Create the file /etc/ttyloc with pairs of tty names
- X (as they appear in /dev) and text. # starts a comment line.
- X ie;
- X
- X # this is a sample old format ttyloc file (/etc/ttyloc)
- X console Console LA120
- X tty00 VADIC 3451
- X tty01 Joe's office
- X
- Xnames.c
- X comes with SAVNLIST set true. Will try and write the file
- X /etc/finger-saved-nlist. Finger should be gived setgrp
- X to this file's group (ie; daemon)
- X
- X================================================================
- X
- XTo add a switch see;
- X switch.h
- X switch.c
- X flags.h
- END_OF_README
- if test 10524 -ne `wc -c <README`; then
- echo shar: \"README\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f SAMPLE-conf -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"SAMPLE-conf\"
- else
- echo shar: Extracting \"SAMPLE-conf\" \(401 characters\)
- sed "s/^X//" >SAMPLE-conf <<'END_OF_SAMPLE-conf'
- X! $Id: finger.conf,v 1.1 90/04/30 20:29:34 budd Exp Locker: budd $
- X%accounts
- Xstaff + Staff Wizards
- Xnseg N Networking Systems
- Xdsg D Distributed Systems
- Xcsg C Central Systems
- Xitother I Information Technology
- Xusrsrv U User Disservices
- Xguest G Guest
- X%phones
- Xx3-####
- Xx#-####
- X(617) ###-####
- X(###) ###-####
- X%buildings
- XM MCS
- XA MCS
- XC CS
- XE ERB
- X%routes
- X.DECNET @BUENGA
- X%prefixes
- XBUIT
- XBU-
- XBU
- X%hidden
- Xgamescontrol
- END_OF_SAMPLE-conf
- if test 401 -ne `wc -c <SAMPLE-conf`; then
- echo shar: \"SAMPLE-conf\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f SAMPLE-flags -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"SAMPLE-flags\"
- else
- echo shar: Extracting \"SAMPLE-flags\" \(50 characters\)
- sed "s/^X//" >SAMPLE-flags <<'END_OF_SAMPLE-flags'
- X/* local-flags for bu-it */
- X/*
- X# define INQUIRE
- X*/
- END_OF_SAMPLE-flags
- echo shar: Missing newline added to \"SAMPLE-flags\"
- if test 50 -ne `wc -c <SAMPLE-flags`; then
- echo shar: \"SAMPLE-flags\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f SAMPLE-nttyloc -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"SAMPLE-nttyloc\"
- else
- echo shar: Extracting \"SAMPLE-nttyloc\" \(746 characters\)
- sed "s/^X//" >SAMPLE-nttyloc <<'END_OF_SAMPLE-nttyloc'
- X# /etc/nttyloc file for buita
- Xttyloc console CTY "Console DECwriter"
- Xrandom ttya ??? "AUX A -- usually the console"
- Xrandom ttyb ??? "AUX B -- not in use"
- Xdialup tty00 "" "Campus Terminal Network"
- Xdialup tty01 "" "Campus Terminal Network"
- Xdialup tty02 "" "Campus Terminal Network"
- Xdialup tty03 "" "Campus Terminal Network"
- Xdialup tty04 "" "Campus Terminal Network"
- Xdialup tty05 "" "Campus Terminal Network"
- Xdialup tty06 "" "Campus Terminal Network"
- Xdialup tty07 "" "Campus Terminal Network"
- Xdialup tty08 ax2400c "ax2400c"
- Xdialup tty09 ax2400c "ax2400c"
- Xrandom tty0a ?? "not in use"
- Xrandom tty0b ?? "not in use"
- Xttyloc tty0c t800 "IT t800"
- Xhardwi tty0d print "IT printer corral"
- Xttyloc tty0e ps800 "IT ps800"
- Xhardwi tty0f SID "IT front office SID"
- END_OF_SAMPLE-nttyloc
- if test 746 -ne `wc -c <SAMPLE-nttyloc`; then
- echo shar: \"SAMPLE-nttyloc\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f VERSION -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"VERSION\"
- else
- echo shar: Extracting \"VERSION\" \(68 characters\)
- sed "s/^X//" >VERSION <<'END_OF_VERSION'
- Xversion 3(400) packed Fri Jul 6 13:21:55 EDT 1990 by budd on bu-it
- END_OF_VERSION
- if test 68 -ne `wc -c <VERSION`; then
- echo shar: \"VERSION\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f WISHES -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"WISHES\"
- else
- echo shar: Extracting \"WISHES\" \(588 characters\)
- sed "s/^X//" >WISHES <<'END_OF_WISHES'
- XAlso grep for WISH in source files;
- X
- X2/3. TOPS-10 and/or TOPS-20 SYSTAT format output
- X
- X19. pipe output to more?
- X
- X20. read .mailrc for aliases (ie; f @mymailiasforfred)
- X
- X26. penalize input from pipe (socket)?
- X hard -- have to read file table
- X
- X30. notify user when being fingered from afar?
- X
- X31. do follow via .rhosts (len) (/rhost-follow ?)
- X
- X32. allow finger <systemwidemailalias>
- X use sendmailbox
- X
- X33. Do faces (c.f. GNU finger)
- X
- X# prevent count from getting theese!!
- Xdate here WISHes in code Total
- X#6/9/88 4 2 6
- X#7/5 7 8 15
- X#6/15/89 5 10 15
- X#6/28 7 9 16
- X#7/6/90 8 9 17
- END_OF_WISHES
- if test 588 -ne `wc -c <WISHES`; then
- echo shar: \"WISHES\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f cc-M -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"cc-M\"
- else
- echo shar: Extracting \"cc-M\" \(696 characters\)
- sed "s/^X//" >cc-M <<'END_OF_cc-M'
- X#! /bin/sh
- X# cc-M - replacement for cc -M
- X# $Id: cc-M,v 3.0 90/07/06 13:10:23 budd Rel $
- X
- Xflags=
- Xfor file in $*
- Xdo
- X case $file in
- X -D*|-U*|-I*)
- X flags="$flags $file"
- X ;;
- X -*)
- X ;;
- X *)
- X echo "# # $file"
- X# on some systems (AIX/RT) system defines are done by cc passing -D flags!!
- X# /lib/cpp $flags < $file | grep '^# 1 "[^"]'
- X cc -E $flags $file | grep '^# 1 "[^"]'
- X
- X ;;
- X esac
- Xdone | awk '
- X/# # / {
- X file = $3
- X lf = length(file)
- X ext = substr(file,lf,1)
- X if (ext == "c" || ext == "y" || ext == "l")
- X left = substr(file,1,lf-1) "o"
- X else
- X left = file
- X print left ": " file
- X next
- X }
- X/^# 1 / { print left ":\t" substr($3,2,length($3) - 2) }
- END_OF_cc-M
- if test 696 -ne `wc -c <cc-M`; then
- echo shar: \"cc-M\" unpacked with wrong size!
- fi
- chmod +x cc-M
- # end of overwriting check
- fi
- if test -f daemon.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"daemon.h\"
- else
- echo shar: Extracting \"daemon.h\" \(656 characters\)
- sed "s/^X//" >daemon.h <<'END_OF_daemon.h'
- X/*
- X * daemon.h -- Different things that can parent a shell -- January 1988
- X *
- X * Copyright (C) 1986, 1990 Philip L. Budne
- X *
- X * This file is part of "Phil's Finger Program".
- X *
- X * This program is free software; you can redistribute it and/or modify
- X * it under the terms of the GNU General Public License as published by
- X * the Free Software Foundation; either version 1, or (at your option)
- X * any later version.
- X *
- X */
- X
- X# define DAEMON_RCSID "$Id: daemon.h,v 3.0 90/07/06 13:10:31 budd Rel $"
- X
- X/*
- X * see also daemon.c, getcommand.c, luser.h and getttyloc.c
- X */
- X
- Xstruct daemon {
- X char
- X *d_cmd,
- X *d_short,
- X *d_long;
- X};
- X
- Xextern struct daemon daemons[];
- END_OF_daemon.h
- if test 656 -ne `wc -c <daemon.h`; then
- echo shar: \"daemon.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f defs.awk -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"defs.awk\"
- else
- echo shar: Extracting \"defs.awk\" \(170 characters\)
- sed "s/^X//" >defs.awk <<'END_OF_defs.awk'
- X/#ifdef/ { print $2 }
- X/#ifndef/ { print $2 }
- X/#define/ { print $2 }
- X
- X/#[ ][ ]*ifdef/ { print $3 }
- X/#[ ][ ]*ifndef/ { print $3 }
- X/#[ ][ ]*define/ { print $3 }
- END_OF_defs.awk
- if test 170 -ne `wc -c <defs.awk`; then
- echo shar: \"defs.awk\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f fingerd.8c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"fingerd.8c\"
- else
- echo shar: Extracting \"fingerd.8c\" \(1654 characters\)
- sed "s/^X//" >fingerd.8c <<'END_OF_fingerd.8c'
- X.\" -*-nroff-*-
- X.\" $Id: fingerd.8c,v 3.0 90/07/06 13:10:42 budd Rel $
- X.\" Copyright (c) 1987, 1990 Philip L. Budne
- X.TH FINGERD 8C "14 June 1988"
- X.UC 4
- X.SH NAME
- Xfingerd \- remote finger server
- X.SH SYNOPSIS
- X.B /etc/fingerd
- X[
- X.B -d
- X]
- X.SH DESCRIPTION
- X.I Fingerd
- Xis the server for RFC742 style remote
- X.IR finger (1)
- Xrequests. If compiled with the SYSLOG option,
- X.I fingerd
- Xlogs the host for each incomming request.
- X
- XOn systems without an
- X.IR inetd (8)
- X.I fingerd
- Xwill for a child which dissowns itself, and exit. If the
- X.B -d
- Xoption is given, fingerd will not fork or disown.
- XThe child listens for incomming connections for the finger/tcp service.
- XIt will then fork a child to handle the connection and continue listening.
- X
- XThe first thing the child does is print a herald which consists of
- Xthe system name, and a line of text from the file
- X.I /etc/monnam
- X(ie; the twenex PS:<SYSTEM>MONNAM.TXT file). If
- X.I monnam
- Xdoes not exist a default message regarding the machine architecture and
- Xoperating system will be printed.
- X
- X.I Fingerd
- Xthen forks
- X.I /usr/ucb/uptime
- Xto print the time, uptime, number of users and load averages.
- X
- XA single line is then read from the socket, parsed and passed
- Xto
- X.I finger
- Xas an argv. Elements in the command line are delmited by space, tab,
- Xcomma, newline, and return.
- X
- X.SH FILES
- X.ta 2i
- X.nf
- X/etc/monnam banner printed by fingerd
- X/usr/ucb/uptime used to display user count and load averages
- X/usr/bin/finger path for finger program to run
- X/etc/nologin printed if it exists
- X.fi
- X.ta
- X.SH "SEE ALSO"
- Xfinger(1)
- X.SH AUTHORS
- XPhilip L. Budne and Barry Z. Shein, Boston University
- X.SH BUGS
- XPerhaps print /etc/motd if no logins allowed?
- END_OF_fingerd.8c
- if test 1654 -ne `wc -c <fingerd.8c`; then
- echo shar: \"fingerd.8c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f getgroup.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"getgroup.c\"
- else
- echo shar: Extracting \"getgroup.c\" \(1263 characters\)
- sed "s/^X//" >getgroup.c <<'END_OF_getgroup.c'
- X/*
- X * getgroup.c -- report file group ID for autoconfig
- X *
- X * Copyright (C) 1988, 1990 Philip L. Budne
- X *
- X * This file is part of "Phil's Finger Program".
- X *
- X * This program is free software; you can redistribute it and/or modify
- X * it under the terms of the GNU General Public License as published by
- X * the Free Software Foundation; either version 1, or (at your option)
- X * any later version.
- X *
- X */
- X
- X# ifndef lint
- Xstatic char *rcsid = "$Id: getgroup.c,v 3.0 90/07/06 13:10:49 budd Rel $";
- Xstatic char Copyright[] = "Copyright (C) 1986, 1990 Philip L. Budne";
- X# endif /* lint not defined */
- X
- X# include <sys/types.h>
- X# include <sys/stat.h>
- X# include <stdio.h>
- X# include <grp.h>
- X/* cannot use finger.h -- run from autoconfig */
- X
- Xextern struct group *getgrgid(); /* USG grp.h loses */
- X
- Xint
- Xmain( c, v )
- X int c;
- X char **v;
- X{
- X struct stat st;
- X struct group *gr;
- X
- X if( c < 1 ) {
- X fprintf( stderr, "Usage %s file\n", v[0] );
- X exit( 1 );
- X }
- X c--;
- X v++;
- X while( c > 0 ) {
- X if( stat( v[0], &st ) < 0 )
- X perror( v[0] );
- X else if( (gr = getgrgid( st.st_gid )) != NULL )
- X printf("%s %d %s\n", v[0], st.st_gid, gr->gr_name );
- X else
- X printf("%s %d\n", v[0], st.st_gid );
- X c--;
- X v++;
- X }
- X return( 0 ); /* be ANSI */
- X} /* main */
- END_OF_getgroup.c
- if test 1263 -ne `wc -c <getgroup.c`; then
- echo shar: \"getgroup.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f global.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"global.c\"
- else
- echo shar: Extracting \"global.c\" \(599 characters\)
- sed "s/^X//" >global.c <<'END_OF_global.c'
- X/*
- X * global.c -- holds global symbols
- X *
- X * Copyright (C) 1986, 1990 Philip L. Budne
- X *
- X * This file is part of "Phil's Finger Program".
- X *
- X * This program is free software; you can redistribute it and/or modify
- X * it under the terms of the GNU General Public License as published by
- X * the Free Software Foundation; either version 1, or (at your option)
- X * any later version.
- X *
- X */
- X
- X# ifndef lint
- Xstatic char *rcsid = "$Id: global.c,v 3.0 90/07/06 13:11:01 budd Rel $";
- X# endif /* lint not defined */
- X
- X# define EXTERN
- X# include "args.h"
- X
- X/*
- X * Local variables:
- X * comment-column: 40
- X * End:
- X */
- END_OF_global.c
- if test 599 -ne `wc -c <global.c`; then
- echo shar: \"global.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test ! -d hungry ; then
- echo shar: Creating directory \"hungry\"
- mkdir hungry
- fi
- if test -f hungry/README -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"hungry/README\"
- else
- echo shar: Extracting \"hungry/README\" \(1050 characters\)
- sed "s/^X//" >hungry/README <<'END_OF_hungry/README'
- XScenario:
- X
- XYou are at your terminal and feeling a bit hungry. Perhaps someone
- Xelse is hungry too! So why eat alone. Now you can tell the world
- Xabout your needs and set you "hunger bit".
- X
- XInstructions:
- X
- XTo tell the world incant "hungry y", to stop type "hungry n", to
- Xwaffle (twiddle) type "hungry ^", to figure out if you are hungry type
- X"hungry". To find out about other needy people type "rwho -h". To
- Xfind people already at lunch, type "rwho -a -h".
- X
- XDisclaimer:
- X
- XThis was written largely as a joke. However it adds little system
- Xoverhead (no additional system calls if you run rwhod) and adds a
- Xlovely "ambiance" to your system.
- X
- XCredits:
- X
- XThe original idea of the HUNGRYP bit comes from JoSH's Twenex
- Xultra-cusp TOPPLE. However setting hunger was a noop since noone
- Xcould see it. I would also like to thank Sally Shepherd for
- Xconvincing me that this was a "good" thing to do.
- X(Sally has "hungry y" in her .login file!!)
- X
- X
- X Phil Budne
- X Boston University / Distributed Systems Groupies
- X budd@bu-it.bu.edu
- X ....!harvard!bu-cs!bu-it!budd
- END_OF_hungry/README
- if test 1050 -ne `wc -c <hungry/README`; then
- echo shar: \"hungry/README\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f hungry/hungry.1c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"hungry/hungry.1c\"
- else
- echo shar: Extracting \"hungry/hungry.1c\" \(960 characters\)
- sed "s/^X//" >hungry/hungry.1c <<'END_OF_hungry/hungry.1c'
- X.TH HUNGRY 1C "30 May 1986"
- X.ds U \fB^\fP
- X.SH NAME
- Xhungry \- set hunger status
- X.SH SYNOPSIS
- X.B hungry
- X[
- X.B y | n | \*U
- X]
- X.SH DESCRIPTION
- X.I hungry
- Xis a new and innovative way to find someone to lunch with, it is
- Xused to inform the system as to whether you are
- X.I hungry
- Xor not.
- XThe command:
- X.RS
- X.nf
- X.B hungry y
- X.RE
- X.fi
- Xsets user status to
- X.I hungry.
- XThe command:
- X.RS
- X.nf
- X.B hungry n
- X.RE
- X.fi
- Xdisables it, while:
- X.RS
- X.nf
- X.B hungry \*U
- X.RE
- X.fi
- Xtoggles the hungry status. Finally, the command:
- X.RS
- X.nf
- X.B hungry
- X.RE
- X.fi
- Xon its own tells you whether your
- X.I hungry
- Xstate is
- X.B y
- Xor
- X.BR n .
- XThe command
- X.B rwho -h
- Xlists all
- X.I hungry
- Xusers on participating systems.
- X
- X.LP
- X.I hungry
- Xoperates asynchronously.
- XIt may take a minute or more for a change in
- X.I hungry
- Xstatus to take effect.
- X
- X.LP
- XAll commands return the
- X.I previous
- Xstatus, true (0) for hungry, false satisfied.
- X
- X.LP
- X.I hungry
- Xworks by setting world execute permission on your tty.
- X
- X.SH SEE ALSO
- Xrwho(1C)
- END_OF_hungry/hungry.1c
- if test 960 -ne `wc -c <hungry/hungry.1c`; then
- echo shar: \"hungry/hungry.1c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f hungry/hungry.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"hungry/hungry.c\"
- else
- echo shar: Extracting \"hungry/hungry.c\" \(1441 characters\)
- sed "s/^X//" >hungry/hungry.c <<'END_OF_hungry/hungry.c'
- X/*
- X * hungry.c -- set/display hunger status
- X * Phil Budne @ Boston University / Distributed Systems
- X */
- X
- X# include <stdio.h>
- X# include <sys/types.h>
- X# include <sys/stat.h>
- X
- X# include "hungry.h"
- X
- Xmain( argc, argv )
- Xint argc;
- Xchar *argv[];
- X{
- X struct stat stb;
- X int f;
- X
- X f = fileno( stderr );
- X if( !isatty( f ) ) {
- X fprintf(stderr, "?no tty\n");
- X exit( 2 );
- X } /* not a tty */
- X
- X if( fstat( f, &stb ) < 0 ) {
- X perror( "fstat" );
- X exit( 2 );
- X } /* fstat failed */
- X
- X if( argc < 2 ) {
- X if( (stb.st_mode & HUNGRY) != 0 )
- X puts("is y");
- X else
- X puts("is n");
- X } /* argc < 2 */
- X else {
- X int newmode;
- X
- X newmode = stb.st_mode & ~S_IFMT; /* clear file format bits */
- X
- X switch( argv[1][0] ) {
- X case 'y':
- X newmode |= HUNGRY;
- X break;
- X
- X case 'n':
- X newmode &= ~HUNGRY;
- X break;
- X
- X case '^': /* toggle! */
- X newmode ^= HUNGRY;
- X break;
- X
- X default:
- X fprintf(stderr, "%s [y n ^]\n", argv[0] );
- X exit( 2 );
- X } /* switch */
- X
- X# ifdef sun /* avoid sun bug */
- X {
- X char *name;
- X extern char *ttyname();
- X
- X if( (name = ttyname( f )) == NULL ) {
- X perror( "ttyname" );
- X exit( 2 );
- X } /* ttyname failed */
- X
- X if( chmod(name, newmode) < 0 )
- X perror( "chmod" );
- X } /* sun */
- X# else
- X if( fchmod(f, newmode) < 0 )
- X perror( "fchmod" );
- X# endif not sun
- X
- X } /* argv >= 2 */
- X
- X if( (stb.st_mode & HUNGRY) == 0 )
- X exit( 1 ); /* false */
- X else
- X exit( 0 ); /* true */
- X} /* main */
- END_OF_hungry/hungry.c
- if test 1441 -ne `wc -c <hungry/hungry.c`; then
- echo shar: \"hungry/hungry.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f hungry/hungry.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"hungry/hungry.h\"
- else
- echo shar: Extracting \"hungry/hungry.h\" \(20 characters\)
- sed "s/^X//" >hungry/hungry.h <<'END_OF_hungry/hungry.h'
- X# define HUNGRY 001
- END_OF_hungry/hungry.h
- if test 20 -ne `wc -c <hungry/hungry.h`; then
- echo shar: \"hungry/hungry.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f hungry/rwho-changes -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"hungry/rwho-changes\"
- else
- echo shar: Extracting \"hungry/rwho-changes\" \(1224 characters\)
- sed "s/^X//" >hungry/rwho-changes <<'END_OF_hungry/rwho-changes'
- Xin rwho.c:
- X****************************************************************
- Xint aflg;
- Xint hflg; /* budd */
- X
- Xmain(argc, argv)
- X int argc;
- X char **argv;
- X{
- X struct direct *dp;
- X int cc, width;
- X register struct whod *w = &wd;
- X register struct whoent *we;
- X register struct myutmp *mp;
- X int f, n, i;
- X
- X argc--;
- X argv++;
- X while( argc > 0 && argv[0][0] == '-' ) { /* reworked - budd */
- X switch( argv[0][1] ) {
- X case 'a':
- X aflg++;
- X break;
- X case 'h': /* budd */
- X hflg++;
- X break;
- X }
- X argc--;
- X argv++;
- X }
- X****************************************************************
- X for (n = cc / sizeof (struct whoent); n > 0; n--) {
- X if (aflg == 0 && we->we_idle >= 60*60) {
- X we++;
- X continue;
- X }
- X# define HC (sizeof( we->we_utmp.out_line )-1) /* budd... */
- X if(hflg != 0 && (we->we_utmp.out_line[HC] & 0200) == 0 ) {
- X we++;
- X continue;
- X }
- X we->we_utmp.out_line[HC] &= ~0200; /* ...budd */
- X
- X if (nusers >= NUSERS) {
- X printf("too many users\n");
- X exit(1);
- X }
- X mp->myutmp = we->we_utmp; mp->myidle = we->we_idle;
- X (void) strcpy(mp->myhost, w->wd_hostname);
- X nusers++; we++; mp++;
- X } /* for */
- X****************************************************************
- END_OF_hungry/rwho-changes
- if test 1224 -ne `wc -c <hungry/rwho-changes`; then
- echo shar: \"hungry/rwho-changes\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f hungry/rwho.1c-changes -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"hungry/rwho.1c-changes\"
- else
- echo shar: Extracting \"hungry/rwho.1c-changes\" \(689 characters\)
- sed "s/^X//" >hungry/rwho.1c-changes <<'END_OF_hungry/rwho.1c-changes'
- X*** rwho.1c-3.5 Mon Jun 27 01:31:44 1988
- X--- rwho.1c Wed Jun 15 02:58:35 1988
- X***************
- X*** 7,12 ****
- X--- 7,15 ----
- X [
- X .B \-a
- X ]
- X+ [
- X+ .B \-h
- X+ ]
- X .SH DESCRIPTION
- X .IX "rwho command" "" "\fLrwho\fP \(em who is logged in on local network"
- X .IX "who is logged in on local network" "" "who is logged in on local network \(em \fLrwho\fP"
- X***************
- X*** 35,43 ****
- X--- 38,52 ----
- X .B \-a
- X report all users whether or not they have typed to the system in the
- X past hour.
- X+ .TP
- X+ .B \-h
- X+ report all users who are
- X+ .I hungry.
- X+
- X .SH FILES
- X /usr/spool/rwho/whod.* information about other machines
- X .SH SEE ALSO
- X+ hungry(1C),
- X ruptime(1C),
- X rwhod(8C)
- X .SH BUGS
- END_OF_hungry/rwho.1c-changes
- if test 689 -ne `wc -c <hungry/rwho.1c-changes`; then
- echo shar: \"hungry/rwho.1c-changes\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f hungry/rwhod-changes -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"hungry/rwhod-changes\"
- else
- echo shar: Extracting \"hungry/rwhod-changes\" \(648 characters\)
- sed "s/^X//" >hungry/rwhod-changes <<'END_OF_hungry/rwhod-changes'
- Xin rwhod.c:
- X****************************************************************
- X# include "......rwhod.h"
- X
- X# define HUNGER 1 /* non-zero to broadcast hunger */
- X# if HUNGER
- X# include "hungry.h"
- X# endif
- X
- X****************************************************************
- X for (i = 0; i < utmpent; i++) {
- X if (stat(we->we_utmp.out_line, &stb) >= 0) {
- X we->we_idle = htonl(now - stb.st_atime);
- X# if HUNGER
- X if( (stb.st_mode & HUNGRY) != 0 ) /* BUDD */
- X we->we_utmp.out_line[ sizeof( we->we_utmp.out_line )-1 ]
- X |= 0200; /* BUDD */
- X# endif
- X }
- X we++;
- X } /* for i */
- X****************************************************************
- END_OF_hungry/rwhod-changes
- if test 648 -ne `wc -c <hungry/rwhod-changes`; then
- echo shar: \"hungry/rwhod-changes\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f inet_netof.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"inet_netof.c\"
- else
- echo shar: Extracting \"inet_netof.c\" \(1421 characters\)
- sed "s/^X//" >inet_netof.c <<'END_OF_inet_netof.c'
- X/*
- X * Copyright (c) 1983 Regents of the University of California.
- X * All rights reserved.
- X *
- X * Redistribution and use in source and binary forms are permitted
- X * provided that the above copyright notice and this paragraph are
- X * duplicated in all such forms and that any documentation,
- X * advertising materials, and other materials related to such
- X * distribution and use acknowledge that the software was developed
- X * by the University of California, Berkeley. The name of the
- X * University may not be used to endorse or promote products derived
- X * from this software without specific prior written permission.
- X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- X * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- X */
- X
- X# if defined(LIBC_SCCS) && !defined(lint)
- Xstatic char sccsid[] = "@(#)inet_netof.c 5.5 (Berkeley) 6/27/88";
- X# endif /* defined(LIBC_SCCS) && !defined(lint) */
- X
- X# include <sys/types.h>
- X# include <netinet/in.h>
- X
- X/*
- X * Return the network number from an internet
- X * address; handles class a/b/c network #'s.
- X */
- Xu_long
- Xinet_netof(in)
- X struct in_addr in;
- X{
- X register u_long i = ntohl(in.s_addr);
- X
- X if (IN_CLASSA(i))
- X return (((i)&IN_CLASSA_NET) >> IN_CLASSA_NSHIFT);
- X else if (IN_CLASSB(i))
- X return (((i)&IN_CLASSB_NET) >> IN_CLASSB_NSHIFT);
- X else
- X return (((i)&IN_CLASSC_NET) >> IN_CLASSC_NSHIFT);
- X}
- END_OF_inet_netof.c
- if test 1421 -ne `wc -c <inet_netof.c`; then
- echo shar: \"inet_netof.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f inet_ntoa.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"inet_ntoa.c\"
- else
- echo shar: Extracting \"inet_ntoa.c\" \(1335 characters\)
- sed "s/^X//" >inet_ntoa.c <<'END_OF_inet_ntoa.c'
- X/*
- X * Copyright (c) 1983 Regents of the University of California.
- X * All rights reserved.
- X *
- X * Redistribution and use in source and binary forms are permitted
- X * provided that the above copyright notice and this paragraph are
- X * duplicated in all such forms and that any documentation,
- X * advertising materials, and other materials related to such
- X * distribution and use acknowledge that the software was developed
- X * by the University of California, Berkeley. The name of the
- X * University may not be used to endorse or promote products derived
- X * from this software without specific prior written permission.
- X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- X * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- X */
- X
- X# if defined(LIBC_SCCS) && !defined(lint)
- Xstatic char sccsid[] = "@(#)inet_ntoa.c 5.4 (Berkeley) 6/27/88";
- X# endif /* defined(LIBC_SCCS) && !defined(lint) */
- X
- X/*
- X * Convert network-format internet address
- X * to base 256 d.d.d.d representation.
- X */
- X# include <sys/types.h>
- X# include <netinet/in.h>
- X
- Xchar *
- Xinet_ntoa(in)
- X struct in_addr in;
- X{
- X static char b[18];
- X register char *p;
- X
- X p = (char *)∈
- X# define UC(b) (((int)b)&0xff)
- X sprintf(b, "%d.%d.%d.%d", UC(p[0]), UC(p[1]), UC(p[2]), UC(p[3]));
- X return (b);
- X}
- END_OF_inet_ntoa.c
- if test 1335 -ne `wc -c <inet_ntoa.c`; then
- echo shar: \"inet_ntoa.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f info.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"info.h\"
- else
- echo shar: Extracting \"info.h\" \(1355 characters\)
- sed "s/^X//" >info.h <<'END_OF_info.h'
- X/*
- X * info.h -- values looked up via nlist for finger
- X *
- X * Copyright (C) 1986, 1990 Philip L. Budne
- X *
- X * This file is part of "Phil's Finger Program".
- X *
- X * This program is free software; you can redistribute it and/or modify
- X * it under the terms of the GNU General Public License as published by
- X * the Free Software Foundation; either version 1, or (at your option)
- X * any later version.
- X *
- X */
- X
- X# define INFO_RCSID "$Id: info.h,v 3.0 90/07/06 13:11:03 budd Rel $"
- X
- X# define VERSTRLEN 80
- X# ifndef _FINGER_H_
- X# include "finger.h" /* for CONC */
- X# endif /* _FINGER_H_ not defined */
- X
- X/*
- X * this carries the creation date of syms.h but not the creation
- X * date of info.h its assumed (bad idea) that any change here
- X * will be refelected in the size of the written file.
- X */
- X
- Xstruct info {
- X char info_fingerversion[ 2*VERSTRLEN ]; /* longversion from finger */
- X /* (just for show) */
- X unsigned long info_kerneldate; /* creation time of /vmunix */
- X unsigned long info_kernelsize; /* file size of /vmunix */
- X unsigned long info_symdate; /* creation time of syms.h */
- X# define SYM(s,sc,m) unsigned long CONC(info_,m) ;
- X# include "syms.h"
- X# undef SYM
- X# ifdef HAVE_VERSION
- X char info_verstr[ VERSTRLEN+1 ]; /* _version from kernel build */
- X# endif /* HAVE_VERSION defined */
- X};
- X
- X/*
- X * Local variables:
- X * comment-column: 40
- X * End:
- X */
- END_OF_info.h
- if test 1355 -ne `wc -c <info.h`; then
- echo shar: \"info.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f inquire.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"inquire.c\"
- else
- echo shar: Extracting \"inquire.c\" \(1640 characters\)
- sed "s/^X//" >inquire.c <<'END_OF_inquire.c'
- X/*
- X * inquire.c -- interface from finger to inquire database (holmes)
- X * October 1986
- X *
- X * Copyright (C) 1988, 1990 Philip L. Budne
- X *
- X * This file is part of "Phil's Finger Program".
- X *
- X * This program is free software; you can redistribute it and/or modify
- X * it under the terms of the GNU General Public License as published by
- X * the Free Software Foundation; either version 1, or (at your option)
- X * any later version.
- X *
- X */
- X
- X# ifndef lint
- Xstatic char *rcsid = "$Id: inquire.c,v 3.0 90/07/06 13:11:05 budd Rel $";
- X# endif /* lint not defined */
- X
- X# include "finger.h"
- X# ifdef INQUIRE /* entire file! */
- X# include <stdio.h>
- X# include "inquire.h"
- X# include "person.h"
- X# include "args.h"
- X
- X
- X# define W(x,y) (pp->CONC(p_,x) = y)
- X# define X(x,y) W(x,savestr(bps[y]))
- X# define Y(x,y) if( bps[y][0] != EOS ) X(x,y); else W(x,NULL)
- X# define Z(x,y,z) if( bps[y][0] != EOS ) W(x,bps[y][0]); else W(x,z)
- X
- XGLOBAL int doinquire( user, pp, bps )
- Xchar *user;
- Xregister PERSON *pp;
- Xregister char *bps[];
- X{
- X if( bps == NULL ) {
- X if( Read( user, BPs ) == NULL )
- X return( FALSE );
- X bps = BPs;
- X }
- X
- X if( bps[_PNAME][0] != EOS ) {
- X char buf[ 120 ];
- X npname( buf, bps[_PNAME]);
- X pp->p_personal = savestr( buf );
- X }
- X
- X Z(group,_GROUP,'?');
- X Z(relation,_REL,'?');
- X
- X if( !sw_whois )
- X return( TRUE );
- X
- X Y(waddr,_WADDR);
- X Y(haddr,_HADDR);
- X
- X Y(wphone,_WPHON);
- X Y(hphone,_HPHON);
- X
- X Y(project,_PROJ);
- X Y(supervisor,_SUPER);
- X
- X Y(nickname,_NNAME);
- X Y(birthday,_BIRTH);
- X Y(remarks,_REM);
- X
- X return( TRUE );
- X} /* doinquire */
- X# endif /* INQUIRE defined */
- X
- X/*
- X * Local variables:
- X * comment-column: 40
- X * End:
- X */
- END_OF_inquire.c
- if test 1640 -ne `wc -c <inquire.c`; then
- echo shar: \"inquire.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f inquire.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"inquire.h\"
- else
- echo shar: Extracting \"inquire.h\" \(700 characters\)
- sed "s/^X//" >inquire.h <<'END_OF_inquire.h'
- X/*
- X * Copyright (C) 1988, 1990 Philip L. Budne
- X *
- X * This file is part of "Phil's Finger Program".
- X *
- X * This program is free software; you can redistribute it and/or modify
- X * it under the terms of the GNU General Public License as published by
- X * the Free Software Foundation; either version 1, or (at your option)
- X * any later version.
- X *
- X */
- X
- X# define INQUIRE_RCSID "$Id: inquire.h,v 3.0 90/07/06 13:11:07 budd Rel $"
- X
- X# ifdef INQUIRE
- X# include "hakinq/helper.h" /* PROTO() */
- X# include "hakinq/fields.h"
- X# include "hakinq/buffer.h"
- X
- X# include "hakinq/person.h" /* one or the other */
- X# include "hakinq/user.h"
- X# include "hakinq/lose.h"
- X
- X# define INQ_INFO char **
- X
- X# endif /* INQUIRE defined */
- END_OF_inquire.h
- if test 700 -ne `wc -c <inquire.h`; then
- echo shar: \"inquire.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f kmem.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"kmem.h\"
- else
- echo shar: Extracting \"kmem.h\" \(1544 characters\)
- sed "s/^X//" >kmem.h <<'END_OF_kmem.h'
- X/*
- X * kmem.h -- interface to kmem.c
- X *
- X * Copyright (C) 1986, 1990 Philip L. Budne
- X *
- X * This file is part of "Phil's Finger Program".
- X *
- X * This program is free software; you can redistribute it and/or modify
- X * it under the terms of the GNU General Public License as published by
- X * the Free Software Foundation; either version 1, or (at your option)
- X * any later version.
- X *
- X */
- X
- X# define KMEM_RCSID "$Id: kmem.h,v 3.0 90/07/06 13:11:11 budd Rel $"
- X
- X# if SunOS >= 400
- X# include <kvm.h>
- X# define FTYPE kvm_t *
- X# define KMEMREAD(p,b,l) kvm_read(kmem, p, b, l)
- X# define ISBADFILE(f) ((f) == NULL)
- X# else /* not SunOS >= 400 */
- X
- X# define BUFIO 0 /* total lose */
- X
- X# if BUFIO
- X# define ISBADFILE(f) (f == NULL)
- X# define BADFILE NULL
- X# define FTYPE FILE *
- X# define OPEN(n) fopen(n, "r")
- X# define CLOSE(f) fclose(f)
- X# define READ(f,buf,cnt) fread(buf,cnt,1,f)
- X# define SEEK(f,o,w) fseek(f,o,w)
- X# define FILENO(f) fileno(f)
- X# else /* not BUFIO */
- X# define ISBADFILE(f) (f < 0)
- X# define BADFILE -1
- X# define FTYPE int
- X# define CLOSE(f) close(f)
- X# define OPEN(n) open(n, 0)
- X# define READ(f,buf,cnt) read(f,buf,cnt)
- X# define SEEK(f,o,w) lseek(f,o,w)
- X# define FILENO(f) (f)
- X# endif /* not BUFIO */
- X
- X# ifdef sgi
- X/* Bletch! remove K0BASE. works for K0 and K2 addrs */
- X# define KVADDR(p) (((unsigned long)(p)) & ~0x80000000 )
- X# else /* sgi not defined */
- X# define KVADDR(p) (p)
- X# endif /* sgi not defined */
- X
- X# define KMEMREAD(p,b,l) kread(kmem, KVADDR(p), b, l)
- X# endif /* not SunOS >= 400 */
- X
- X/*
- X * Local variables:
- X * comment-column: 40
- X * End:
- X */
- END_OF_kmem.h
- if test 1544 -ne `wc -c <kmem.h`; then
- echo shar: \"kmem.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f locname.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"locname.c\"
- else
- echo shar: Extracting \"locname.c\" \(1083 characters\)
- sed "s/^X//" >locname.c <<'END_OF_locname.c'
- X/*
- X * locname.c -- create ttyloc file paths for ttyloc.c and finger
- X *
- X * Copyright (C) 1986, 1990 Philip L. Budne
- X *
- X * This file is part of "Phil's Finger Program".
- X *
- X * This program is free software; you can redistribute it and/or modify
- X * it under the terms of the GNU General Public License as published by
- X * the Free Software Foundation; either version 1, or (at your option)
- X * any later version.
- X *
- X */
- X
- X# ifndef lint
- Xstatic char *rcsid = "$Id: locname.c,v 3.0 90/07/06 13:11:15 budd Rel $";
- X# endif /* lint not defined */
- X
- X# include "finger.h"
- X
- Xextern char localhost[];
- X
- XLOCAL char *_locname(type, ttyname)
- X char *type, *ttyname;
- X{
- X static char buffer[200];
- X sprintf(buffer, "%s/%s_%s_%s", TTYLOC_DIR, type, localhost, ttyname);
- X return( buffer );
- X} /* _locname */
- X
- XGLOBAL char *locname( ttyname )
- X char *ttyname;
- X{
- X return( _locname("ttyloc", ttyname ) );
- X} /* locname */
- X
- XGLOBAL char *netlocname( ttyname )
- X char *ttyname;
- X{
- X return( _locname("netloc", ttyname ) );
- X} /* netlocname */
- X
- X
- X/*
- X * Local variables:
- X * comment-column: 40
- X * End:
- X */
- END_OF_locname.c
- if test 1083 -ne `wc -c <locname.c`; then
- echo shar: \"locname.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f make-version -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"make-version\"
- else
- echo shar: Extracting \"make-version\" \(1240 characters\)
- sed "s/^X//" >make-version <<'END_OF_make-version'
- X#! /bin/sh
- X#
- X# make-version -- shell script to create version.c for finger
- X#
- X# Copyright (C) 1987, 1990 Philip L. Budne
- X#
- X# This file is part of "Phil's Finger Program".
- X#
- X# This program is free software; you can redistribute it and/or modify
- X# it under the terms of the GNU General Public License as published by
- X# the Free Software Foundation; either version 1, or (at your option)
- X# any later version.
- X#
- X
- X# $Id: make-version,v 3.0 90/07/06 13:11:18 budd Rel $
- X
- Xif [ -r BUILD ]
- Xthen
- X build=`cat BUILD`
- X if expr $build + 1 > /dev/null 2>&1
- X then
- X build=`expr $build + 1`
- X else
- X echo bad BUILD file '"'$build'"' -- resetting 1>&2
- X build=1
- X fi
- Xelse
- X echo creating new BUILD file 1>&2
- X build=1
- Xfi
- Xecho $build > BUILD
- Xecho build $build 1>&2
- X
- Xecho '/* This file is created by the script make-version */'
- Xif test -f /bin/hostname ; then
- X HOST=`/bin/hostname`
- Xelse
- X HOST=`/bin/uname -n`
- Xfi
- X
- Xcat <<EOF
- Xchar version[] = "`./pversion`";
- Xchar build_who[] = "`./mywhoami`";
- Xchar build_host[] = "$HOST";
- Xchar build_dir[] = "`pwd`";
- Xchar build_date[] = "`date`";
- Xint build_number = $build;
- X
- Xchar longversion[] = "This is finger version `./pversion` build #$build by `./mywhoami` at $HOST\non `date` in `pwd`";
- XEOF
- Xexit 0
- END_OF_make-version
- if test 1240 -ne `wc -c <make-version`; then
- echo shar: \"make-version\" unpacked with wrong size!
- fi
- chmod +x make-version
- # end of overwriting check
- fi
- if test -f myecho.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"myecho.c\"
- else
- echo shar: Extracting \"myecho.c\" \(909 characters\)
- sed "s/^X//" >myecho.c <<'END_OF_myecho.c'
- X/*
- X * myecho.c -- avoid Sys V compatible echo (interprets \n) for make-version
- X *
- X * Copyright (C) 1988, 1990 Philip L. Budne
- X *
- X * This file is part of "Phil's Finger Program".
- X *
- X * This program is free software; you can redistribute it and/or modify
- X * it under the terms of the GNU General Public License as published by
- X * the Free Software Foundation; either version 1, or (at your option)
- X * any later version.
- X *
- X */
- X
- X# ifndef lint
- Xstatic char *rcsid = "$Id: myecho.c,v 3.0 90/07/06 13:11:21 budd Rel $";
- X# endif /* lint not defined */
- X
- X# include <stdio.h>
- X# include "finger.h"
- X
- Xmain( c, v )
- X int c;
- X char **v;
- X{
- X int i, newline;
- X c--;
- X v++;
- X
- X newline = 1;
- X if( strcmp( *v, "-n" ) == 0 ) {
- X c--;
- X v++;
- X newline = 0;
- X }
- X while( c-- > 0 ) {
- X if( i++ > 0 )
- X putchar(' ');
- X printf("%s", *v++ );
- X } /* for */
- X if( newline )
- X putchar('\n');
- X exit( 0 );
- X} /* main */
- END_OF_myecho.c
- if test 909 -ne `wc -c <myecho.c`; then
- echo shar: \"myecho.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f mywhoami.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"mywhoami.c\"
- else
- echo shar: Extracting \"mywhoami.c\" \(1022 characters\)
- sed "s/^X//" >mywhoami.c <<'END_OF_mywhoami.c'
- X/*
- X * mywhoami.c -- whoami for makefile/make-version on USG systems
- X *
- X * Copyright (C) 1989, 1990 Philip L. Budne
- X *
- X * This file is part of "Phil's Finger Program".
- X *
- X * This program is free software; you can redistribute it and/or modify
- X * it under the terms of the GNU General Public License as published by
- X * the Free Software Foundation; either version 1, or (at your option)
- X * any later version.
- X *
- X */
- X
- X# ifndef lint
- Xstatic char *rcsid = "$Id: mywhoami.c,v 3.0 90/07/06 13:11:22 budd Rel $";
- Xstatic char Copyright[] = "Copyright (C) 1986, 1990 Philip L. Budne";
- X# endif /* lint not defined */
- X
- X# include <stdio.h>
- X# include <pwd.h>
- X
- Xextern char *getenv();
- Xextern struct passwd *getpwuid(); /* USG pwd.h */
- X
- X# define IFENV(v) if( (e = getenv(v)) != NULL ) puts( e )
- X
- Xint
- Xmain() {
- X struct passwd *pw;
- X char *e;
- X
- X if( (pw = getpwuid( getuid())) != NULL )
- X puts( pw->pw_name );
- X else IFENV( "USER" );
- X else IFENV( "LOGNAME" );
- X else
- X puts("???");
- X return( 0 ); /* be ANSI */
- X} /* main */
- X
- END_OF_mywhoami.c
- if test 1022 -ne `wc -c <mywhoami.c`; then
- echo shar: \"mywhoami.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f output.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"output.h\"
- else
- echo shar: Extracting \"output.h\" \(570 characters\)
- sed "s/^X//" >output.h <<'END_OF_output.h'
- X/*
- X * output.h -- output defns for new finger
- X *
- X * Copyright (C) 1986, 1990 Philip L. Budne
- X *
- X * This file is part of "Phil's Finger Program".
- X *
- X * This program is free software; you can redistribute it and/or modify
- X * it under the terms of the GNU General Public License as published by
- X * the Free Software Foundation; either version 1, or (at your option)
- X * any later version.
- X *
- X */
- X
- X# define OUTPUT_RCSID "$Id: output.h,v 3.0 90/07/06 13:11:31 budd Rel $"
- X
- X# define MAXLINE 200
- X# define OUTPUT stdout
- X
- X/*
- X * Local variables:
- X * comment-column: 40
- X * End:
- X */
- END_OF_output.h
- if test 570 -ne `wc -c <output.h`; then
- echo shar: \"output.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f person.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"person.h\"
- else
- echo shar: Extracting \"person.h\" \(1752 characters\)
- sed "s/^X//" >person.h <<'END_OF_person.h'
- X/*
- X * person.h -- person structure for finger (per username)
- X * December 1985
- X *
- X * Copyright (C) 1986, 1990 Philip L. Budne
- X *
- X * This file is part of "Phil's Finger Program".
- X *
- X * This program is free software; you can redistribute it and/or modify
- X * it under the terms of the GNU General Public License as published by
- X * the Free Software Foundation; either version 1, or (at your option)
- X * any later version.
- X *
- X */
- X
- X# define PERSON_RCSID "$Id: person.h,v 3.0 90/07/06 13:11:32 budd Rel $"
- X
- X# ifdef _PERSON_
- X OOPS!! /* loaded twice, or luser.h loaded first!! */
- X# endif /* _PERSON_ defined */
- X# define _PERSON_ /* say we have loaded! */
- X
- X# define PLEN 33 /* personal name length */
- X
- Xtypedef struct person {
- X short p_count; /* use count */
- X short p_uid, p_gid; /* user id, group id */
- X
- X short p_flags;
- X# define P_RC 01 /* gecos == "RC" */
- X# define P_INQUIRE 02 /* data came from inquire/holmes */
- X# define P_NOPWENT 04 /* no passwd entry */
- X
- X char *p_home; /* home directory */
- X char *p_shell; /* default shell */
- X
- X char *p_personal; /* personal name */
- X char *p_waddr; /* work address */
- X char *p_wphone; /* work phone */
- X char *p_hphone; /* home phone */
- X
- X/* below here not from password file */
- X char *p_project; /* first line of .project */
- X char *p_maddr; /* mailing address (from .forward) */
- X
- X/* below here from inquire database */
- X char *p_supervisor; /* yes */
- X char *p_nickname; /* what I like to be called */
- X char *p_birthday; /* yes */
- X char *p_haddr; /* home address */
- X char *p_remarks; /* clever stuff here */
- X char p_group; /* user group */
- X char p_relation; /* relation to group */
- X} PERSON;
- X
- X/*
- X * Local variables:
- X * comment-column: 40
- X * End:
- X */
- END_OF_person.h
- if test 1752 -ne `wc -c <person.h`; then
- echo shar: \"person.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f pr.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"pr.h\"
- else
- echo shar: Extracting \"pr.h\" \(1591 characters\)
- sed "s/^X//" >pr.h <<'END_OF_pr.h'
- X/*
- X * pr.h -- process table structure for finger
- X *
- X * Copyright (C) 1986, 1990 Philip L. Budne
- X *
- X * This file is part of "Phil's Finger Program".
- X *
- X * This program is free software; you can redistribute it and/or modify
- X * it under the terms of the GNU General Public License as published by
- X * the Free Software Foundation; either version 1, or (at your option)
- X * any later version.
- X *
- X */
- X
- X# define PR_RCSID "$Id: pr.h,v 3.0 90/07/06 13:11:33 budd Rel $"
- X
- Xenum sig { S_DEFAULT=1, S_IGNORE, S_CATCH, S_HOLD };
- X# define SIGNAME "?DICH?"
- X
- Xstruct pr {
- X /* from proc struct */
- X short pr_pid; /* proc.p_pid process pid */
- X short pr_ppid; /* proc.p_ppid parent pid */
- X short pr_pgrp; /* proc.p_pgrp pgrp leader pid */
- X short pr_uid; /* proc.p_uid userid */
- X char pr_flag; /* proc.p_flag process flags (SWAP) */
- X caddr_t pr_wchan; /* proc.p_wchan wait addr */
- X char pr_stat; /* proc.p_stat state 1..6 */
- X
- X /* from user struct */
- X dev_t pr_ttyd; /* user.u_ttyd tty device of process */
- X char pr_cmd[15]; /* user.u_comm command name */
- X# ifdef SHORT_TTYP
- X short *pr_ttyp; /* user.u_ttyp ptr to tpg in stream */
- X# else /* SHORT_TTYP not defined */
- X struct tty *pr_ttyp; /* user.u_ttyp pointer to tty str */
- X# endif /* SHORT_TTYP not defined */
- X enum sig pr_intr, /* state of SIGINT */
- X pr_quit, /* state of SIGQUIT */
- X pr_hup; /* state of SIGHUP */
- X
- X /* derived */
- X SIGNED long pr_weight; /* heuristic display weight */
- X};
- X
- Xvoid dumppr();
- X/*
- X * Local variables:
- X * comment-column: 40
- X * End:
- X */
- END_OF_pr.h
- if test 1591 -ne `wc -c <pr.h`; then
- echo shar: \"pr.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f pversion.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"pversion.c\"
- else
- echo shar: Extracting \"pversion.c\" \(1082 characters\)
- sed "s/^X//" >pversion.c <<'END_OF_pversion.c'
- X/*
- X * pversion -- display finger version for build procedure
- X *
- X * Copyright (C) 1986, 1990 Philip L. Budne
- X *
- X * This file is part of "Phil's Finger Program".
- X *
- X * This program is free software; you can redistribute it and/or modify
- X * it under the terms of the GNU General Public License as published by
- X * the Free Software Foundation; either version 1, or (at your option)
- X * any later version.
- X *
- X */
- X
- X# include "finger.h"
- X# include "History.h"
- X
- X# ifndef lint
- Xstatic char *history_rcsid = HISTORY_RCSID;
- Xstatic char *rcsid = "$Id: pversion.c,v 3.0 90/07/06 13:11:35 budd Rel $";
- X# endif /* lint not defined */
- X
- Xint main() {
- X printf("%o", ver.major );
- X if( ver.minor != 0 ) {
- X int m1;
- X if( ver.minor > 25 ) {
- X m1 = ver.minor / 26;
- X if( m1 > 26 )
- X m1 = 26;
- X printf("%c", 'A' + m1 - 1 );
- X ver.minor %= 26;
- X } /* more than one letter? */
- X printf("%c", 'A' + ver.minor - 1 );
- X } /* minor version */
- X printf("(%o)", ver.edit );
- X if( ver.who != 0 )
- X printf("-%o", ver.who );
- X puts("");
- X return( 0 ); /* be a good ANSI program */
- X} /* main */
- END_OF_pversion.c
- if test 1082 -ne `wc -c <pversion.c`; then
- echo shar: \"pversion.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f remote.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"remote.h\"
- else
- echo shar: Extracting \"remote.h\" \(876 characters\)
- sed "s/^X//" >remote.h <<'END_OF_remote.h'
- X/*
- X * remote.h -- structs for remote user input
- X *
- X * Copyright (C) 1986, 1990 Philip L. Budne
- X *
- X * This file is part of "Phil's Finger Program".
- X *
- X * This program is free software; you can redistribute it and/or modify
- X * it under the terms of the GNU General Public License as published by
- X * the Free Software Foundation; either version 1, or (at your option)
- X * any later version.
- X *
- X */
- X
- X# define REMOTE_RCSID "$Id: remote.h,v 3.0 90/07/06 13:11:40 budd Rel $"
- X
- Xtypedef struct rhost {
- X char *rh_name; /* host name */
- X struct rhost *rh_next; /* next host in chain */
- X struct ruser *rh_user; /* pointer to user chain */
- X struct ruser *rh_endu; /* end of user chain */
- X} RHOST;
- X
- Xtypedef struct ruser {
- X char *ru_name; /* user name */
- X struct ruser *ru_next; /* next in chain */
- X} RUSER;
- X
- X/*
- X * Local variables:
- X * comment-column: 40
- X * End:
- X */
- END_OF_remote.h
- if test 876 -ne `wc -c <remote.h`; then
- echo shar: \"remote.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f skip.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"skip.c\"
- else
- echo shar: Extracting \"skip.c\" \(1052 characters\)
- sed "s/^X//" >skip.c <<'END_OF_skip.c'
- X/*
- X * skip.c -- skip white and non (July 1987)
- X *
- X * Copyright (C) 1986, 1990 Philip L. Budne
- X *
- X * This file is part of "Phil's Finger Program".
- X *
- X * This program is free software; you can redistribute it and/or modify
- X * it under the terms of the GNU General Public License as published by
- X * the Free Software Foundation; either version 1, or (at your option)
- X * any later version.
- X *
- X */
- X
- X# ifndef lint
- Xstatic char *rcsid = "$Id: skip.c,v 3.0 90/07/06 13:11:43 budd Rel $";
- X# endif /* lint not defined */
- X
- X# include <ctype.h>
- X# include "finger.h"
- X
- XGLOBAL int skipwhite( cpp )
- Xchar **cpp;
- X{
- X register char *cp = *cpp;
- X while( *cp != EOS && isspace( *cp ) )
- X cp++;
- X *cpp = cp;
- X if( *cp == EOS )
- X return( FALSE );
- X else
- X return( TRUE );
- X} /* skipwhite */
- X
- XGLOBAL int skipblack( cpp )
- Xchar **cpp;
- X{
- X register char *cp = *cpp;
- X while( *cp != EOS && !isspace( *cp ) )
- X cp++;
- X *cpp = cp;
- X if( *cp == EOS )
- X return( FALSE );
- X else
- X return( TRUE );
- X} /* skipblack */
- X
- X/*
- X * Local variables:
- X * comment-column: 40
- X * End:
- X */
- END_OF_skip.c
- if test 1052 -ne `wc -c <skip.c`; then
- echo shar: \"skip.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f strings.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"strings.h\"
- else
- echo shar: Extracting \"strings.h\" \(790 characters\)
- sed "s/^X//" >strings.h <<'END_OF_strings.h'
- X/*
- X * strings.h - help for systems without old style string functions
- X *
- X * Copyright (C) 1989, 1990 Philip L. Budne
- X *
- X * This file is part of "Phil's Finger Program".
- X *
- X * This program is free software; you can redistribute it and/or modify
- X * it under the terms of the GNU General Public License as published by
- X * the Free Software Foundation; either version 1, or (at your option)
- X * any later version.
- X *
- X */
- X
- X# define STRINGS_RCSID "$Id: strings.h,v 3.0 90/07/06 13:11:47 budd Rel $"
- X
- X# ifndef _STRINGS_H_
- X# define _STRINGS_H_
- X
- X# include <string.h> /* sigh.. nested include */
- X# define index(s,c) strchr(s,c)
- X# define rindex(s,c) strrchr(s,c) /* what a dumb name! */
- X
- X# define bzero(s,c) memset(s,'\0',c)
- X# define bcopy(s,d,c) memcpy(d,s,c)
- X# endif /* _STRINGS_H_ not defined */
- END_OF_strings.h
- if test 790 -ne `wc -c <strings.h`; then
- echo shar: \"strings.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f symdate.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"symdate.c\"
- else
- echo shar: Extracting \"symdate.c\" \(947 characters\)
- sed "s/^X//" >symdate.c <<'END_OF_symdate.c'
- X/*
- X * symdate.c -- stand alone prog to write symdate.h
- X *
- X * Copyright (C) 1986, 1990 Philip L. Budne
- X *
- X * This file is part of "Phil's Finger Program".
- X *
- X * This program is free software; you can redistribute it and/or modify
- X * it under the terms of the GNU General Public License as published by
- X * the Free Software Foundation; either version 1, or (at your option)
- X * any later version.
- X *
- X */
- X
- X# ifndef lint
- Xstatic char *rcsid = "$Id: symdate.c,v 3.0 90/07/06 13:11:52 budd Rel $";
- X# endif /* lint not defined */
- X
- X# include <stdio.h>
- X# include <sys/types.h>
- X# include <sys/stat.h>
- X# include "finger.h"
- X
- Xmain(argc, argv)
- Xint argc;
- Xchar *argv[];
- X{
- X struct stat stb;
- X
- X if( argc != 2 )
- X fprintf(stderr, "%s file\n", argv[0] );
- X else if( stat( argv[1], &stb ) < 0 )
- X perror( argv[1] );
- X else {
- X printf("%ld\n", stb.st_mtime );
- X exit( 0 );
- X }
- X exit( 1 );
- X} /* main */
- X
- X/*
- X * Local variables:
- X * comment-column: 40
- X * End:
- X */
- END_OF_symdate.c
- if test 947 -ne `wc -c <symdate.c`; then
- echo shar: \"symdate.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f tsel.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"tsel.h\"
- else
- echo shar: Extracting \"tsel.h\" \(739 characters\)
- sed "s/^X//" >tsel.h <<'END_OF_tsel.h'
- X/*
- X * tsel.h -- structures for user input "terminal selectors"
- X *
- X * Copyright (C) 1987, 1990 Philip L. Budne
- X *
- X * This file is part of "Phil's Finger Program".
- X *
- X * This program is free software; you can redistribute it and/or modify
- X * it under the terms of the GNU General Public License as published by
- X * the Free Software Foundation; either version 1, or (at your option)
- X * any later version.
- X *
- X */
- X
- X# define TSEL_RCSID "$Id: tsel.h,v 3.0 90/07/06 13:11:55 budd Rel $"
- X
- Xtypedef struct tsel {
- X char *ts_name; /* name of selector */
- X short ts_len; /* length of string */
- X short ts_len2; /* length - 3 */
- X struct tsel *ts_next; /* next in chain */
- X} TSEL;
- X
- X/*
- X * Local variables:
- X * comment-column: 40
- X * End:
- X */
- END_OF_tsel.h
- if test 739 -ne `wc -c <tsel.h`; then
- echo shar: \"tsel.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f ttylocfile.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"ttylocfile.h\"
- else
- echo shar: Extracting \"ttylocfile.h\" \(1182 characters\)
- sed "s/^X//" >ttylocfile.h <<'END_OF_ttylocfile.h'
- X/*
- X * ttylocfile.h -- defns to read /etc/ttyloc (December 1985)
- X /*
- X * Copyright (C) 1986, 1990 Philip L. Budne
- X *
- X * This file is part of "Phil's Finger Program".
- X *
- X * This program is free software; you can redistribute it and/or modify
- X * it under the terms of the GNU General Public License as published by
- X * the Free Software Foundation; either version 1, or (at your option)
- X * any later version.
- X *
- X */
- X
- X# define TTYLOCFILE_RCSID "$Id: ttylocfile.h,v 3.0 90/07/06 13:12:05 budd Rel $"
- X
- X# ifndef LOCFILE
- X# define LOCFILE "/etc/ttyloc"
- X# endif /* LOCFILE not defined */
- X
- X# ifndef NLOCFILE
- X# define NLOCFILE "/etc/nttyloc" /* new format file */
- X# endif /* NLOCFILE not defined */
- X
- X# ifndef MAXTTY
- X# define MAXTTY 100 /* number of ttys on system */
- X# endif /* MAXTTY not defined */
- X
- Xtypedef enum { LT_HARD, LT_TTYLOC, LT_DIALUP, LT_UNKNOWN } LINETYPE;
- X
- Xtypedef struct ttyloc {
- X char *t_name; /* terminal name */
- X char *t_locn; /* default (long) terminal location */
- X char *t_short; /* short locn (prepended to user str) */
- X LINETYPE t_type; /* line type */
- X} TTYLOC;
- X
- Xextern TTYLOC *findttyloc();
- X
- X/*
- X * Local variables:
- X * comment-column: 40
- X * End:
- X */
- END_OF_ttylocfile.h
- if test 1182 -ne `wc -c <ttylocfile.h`; then
- echo shar: \"ttylocfile.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f upper.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"upper.c\"
- else
- echo shar: Extracting \"upper.c\" \(819 characters\)
- sed "s/^X//" >upper.c <<'END_OF_upper.c'
- X/*
- X * upper.c -- uppercaseification table
- X *
- X * Copyright (C) 1988, 1990 Philip L. Budne
- X *
- X * This file is part of "Phil's Finger Program".
- X *
- X * This program is free software; you can redistribute it and/or modify
- X * it under the terms of the GNU General Public License as published by
- X * the Free Software Foundation; either version 1, or (at your option)
- X * any later version.
- X *
- X */
- X
- X# ifndef lint
- Xstatic char *rcsid = "$Id: upper.c,v 3.0 90/07/06 13:12:08 budd Rel $";
- X# endif /* lint not defined */
- X
- X# include "finger.h"
- X# include "upper.h"
- X
- XGLOBAL char uppercase[] = "\
- X\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\
- X\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\
- X !\"#$%&'()*+,-./0123456789:;<=>?\
- X@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\
- X`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~\177";
- END_OF_upper.c
- if test 819 -ne `wc -c <upper.c`; then
- echo shar: \"upper.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f upper.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"upper.h\"
- else
- echo shar: Extracting \"upper.h\" \(519 characters\)
- sed "s/^X//" >upper.h <<'END_OF_upper.h'
- X/*
- X * upper.h -- extern for uppercaseification table
- X *
- X * Copyright (C) 1986, 1990 Philip L. Budne
- X *
- X * This file is part of "Phil's Finger Program".
- X *
- X * This program is free software; you can redistribute it and/or modify
- X * it under the terms of the GNU General Public License as published by
- X * the Free Software Foundation; either version 1, or (at your option)
- X * any later version.
- X *
- X */
- X
- X# define UPPER_RCSID "$Id: upper.h,v 3.0 90/07/06 13:12:09 budd Rel $"
- X
- X# include "finger.h"
- Xextern char uppercase[];
- END_OF_upper.h
- if test 519 -ne `wc -c <upper.h`; then
- echo shar: \"upper.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f waitstate.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"waitstate.h\"
- else
- echo shar: Extracting \"waitstate.h\" \(1128 characters\)
- sed "s/^X//" >waitstate.h <<'END_OF_waitstate.h'
- X/*
- X * waitstate.h -- wait state enumeration (once was ttystate.h)
- X *
- X * Copyright (C) 1987, 1990 Philip L. Budne
- X *
- X * This file is part of "Phil's Finger Program".
- X *
- X * This program is free software; you can redistribute it and/or modify
- X * it under the terms of the GNU General Public License as published by
- X * the Free Software Foundation; either version 1, or (at your option)
- X * any later version.
- X *
- X */
- X
- X# define FOO_RCSID "$Id: waitstate.h,v 3.0 90/07/06 13:12:16 budd Rel $"
- X
- X# define _STATES \
- X _STATE(00) /* NULL */ \
- X _STATE(TI) /* tty input */ \
- X _STATE(TO) /* tty output */ \
- X _STATE(TW) /* tty wait */ \
- X _STATE(SE) /* select(2) */ \
- X _STATE(RU) /* runable */ \
- X _STATE(PA) /* pause(2) */ \
- X _STATE(WA) /* wait(2) */ \
- X _STATE(SL) /* other */
- X
- Xtypedef enum {
- X# define _STATE(s) CONC(WS_,s),
- X _STATES
- X WS_XX /* use up extra comma */
- X# undef _STATE
- X} waitstate_t;
- X
- X# ifdef WAITSTATENAME
- Xchar *WAITSTATENAME[] = {
- X# define _STATE(s) STR(s),
- X _STATES
- X "XX"
- X };
- X# undef _STATE
- X# endif /* WAITSTATENAME defined */
- X
- X/*
- X * Local variables:
- X * comment-column: 40
- X * End:
- X */
- END_OF_waitstate.h
- if test 1128 -ne `wc -c <waitstate.h`; then
- echo shar: \"waitstate.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- echo shar: End of archive 1 \(of 7\).
- cp /dev/null ark1isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 7 archives.
- rm -f ark[1-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-
-